<?php $this->headScript()->appendFile($this->baseUrl() . "/plugins/datatables/jquery.dataTables.min.js","text/javascript"); ?>
<?php $this->headScript()->appendFile($this->baseUrl() . "/plugins/validate/jquery.validate.js","text/javascript"); ?>
<?php $this->headScript()->appendFile($this->baseUrl() . "/js/modules/safety/Role.js","text/javascript"); ?>
<?php $this->headScript()->appendFile($this->baseUrl() . "/js/demo/demo.tables.js","text/javascript"); ?>

<?php $this->headScript()->captureStart(); ?>
	$(document).ready(function() {	
		
		var role = new com.em.Role();
		// network
		role.setUrl({
			toTable : '<?php echo $this->url(array('action'=>'read-items')); ?>',
			toUpdate : '<?php echo $this->url(array('action'=>'update', 'format'=>'html')); ?>',
		});
		
		// configuration of widgets
		role.configureTable('#tblroles');
		
		// CRUD
		role.clickToAdd('#add-role');
		role.clickToDelete('#delete-role');
	});
<?php $this->headScript()->captureEnd(); ?>
						<div class="grid_4">
                        	<div class="da-panel collapsible">
                            	<div class="da-panel-header">
                                	<span class="da-panel-title">
                                        <img src="/images/icons/black/16/list.png" alt="" />
                                        <?php echo $this->translate('List Roles'); ?>
                                    </span>
                                    
                                </div>
                                <div class="da-panel-toolbar top">
                                    <ul>
                                        <li><a href="<?php echo $this->url(array('action'=>'create', 'format'=>'html')); ?>" id="add-role"><img src="/images/icons/color/add.png" alt="" /><?php echo $this->translate('Add'); ?></a></li>
                                        <li><a href="<?php echo $this->url(array('action'=>'delete')); ?>" id="delete-role"><img src="/images/icons/color/cross.png" alt="" /><?php echo $this->translate('Delete'); ?></a></li>
                                        <li><a href="#"><img src="/images/icons/color/arrow_redo.png" alt="" /><?php echo $this->translate('Refresh'); ?></a></li>
                                    </ul>
                                </div> 
                                <div class="da-panel-content">
                                    <table id="tblroles" class="da-table">
                                        <thead>
                                            <tr>
                                            	<th><input type="checkbox" value="0"></th>
												<th><?php echo $this->translate('Name'); ?></th>
												<th><?php echo $this->translate('Description'); ?></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                       
                        <div id="dialog-form">
							<!--	load ajax dialog form	-->
						</div>
						